import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:graduation_project/cartoon_module/cartoon_list_three.dart';
import 'package:graduation_project/cartoon_module/vertical_list_view.dart';

class found_six_mod extends StatefulWidget {
  found_six_mod({Key key, this.title_id}) : super(key: key);
  int title_id;
  @override
  State<found_six_mod> createState() => _found_six_modState();
}

class _found_six_modState extends State<found_six_mod> {
  String title;
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    // 通过已知的title_id知道类别和获取数据
  }

  List cartoon_list0 = [
    {
      "cartoon_id": 1,
      "cartoon_name": "间谍过家家",
      "cartoon_tage": 4,
      "cartoon_leader_image":
          "https://nianyiman-1309342317.cos-website.ap-guangzhou.myqcloud.com/jdgjj/jdgjj0.png"
    },
    {
      "cartoon_id": 2,
      "cartoon_name": "间谍过家家1",
      "cartoon_tage": 1,
      "cartoon_leader_image":
          "https://nianyiman-1309342317.cos-website.ap-guangzhou.myqcloud.com/jdgjj/jdgjj0.png"
    },
    {
      "cartoon_id": 3,
      "cartoon_name": "间谍过家家2",
      "cartoon_tage": 1,
      "cartoon_leader_image":
          "https://nianyiman-1309342317.cos-website.ap-guangzhou.myqcloud.com/jdgjj/jdgjj0.png"
    },
    {
      "cartoon_id": 4,
      "cartoon_name": "间谍过家家3",
      "cartoon_tage": 3,
      "cartoon_leader_image":
          "https://nianyiman-1309342317.cos-website.ap-guangzhou.myqcloud.com/jdgjj/jdgjj0.png"
    },
    {
      "cartoon_id": 5,
      "cartoon_name": "间谍过家家4",
      "cartoon_tage": 5,
      "cartoon_leader_image":
          "https://nianyiman-1309342317.cos-website.ap-guangzhou.myqcloud.com/jdgjj/jdgjj0.png"
    },
    {
      "cartoon_id": 6,
      "cartoon_name": "间谍过家家5",
      "cartoon_tage": 0,
      "cartoon_leader_image":
          "https://nianyiman-1309342317.cos-website.ap-guangzhou.myqcloud.com/jdgjj/jdgjj0.png"
    },
  ];

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          Container(
            margin: EdgeInsets.only(top: 20, bottom: 10),
            child: Row(
              children: [
                Container(
                    margin: EdgeInsets.only(left: 10),
                    child: Text(
                      '今日热门速递',
                      style: TextStyle(fontSize: 16),
                    )),
                Expanded(child: SizedBox()),
                InkWell(
                  onTap: () {
                    print(widget.title_id);
                    Navigator.push(context, MaterialPageRoute(builder: (_) {
                      return Scaffold(
                        appBar: AppBar(
                          backgroundColor: Colors.white,
                          title: Text(
                            'title_id',
                            style: TextStyle(color: Colors.black87),
                          ),
                          centerTitle: true,
                          iconTheme: IconThemeData(
                            color: Colors.black87, //修改颜色
                          ),
                        ),
                        body: vertical_list_view(
                          list_id: 102,
                        ),
                      );
                    }));
                    // vertical_list_view
                  },
                  child: Container(
                    margin: EdgeInsets.only(right: 4),
                    child: Row(
                      children: [
                        Text(
                          '查看全部',
                          style: TextStyle(fontSize: 12, color: Colors.black54),
                        ),
                        Icon(
                          Icons.keyboard_arrow_right,
                          color: Colors.black54,
                        ),
                      ],
                    ),
                  ),
                )
              ],
            ),
          ),
          cartoon_list_three(
            cartoon_list: cartoon_list0,
          ),
          InkWell(
            onTap: () {
              print('重新获取');
            },
            child: Container(
              width: 180,
              height: 35,
              // color: Colors.red,
              alignment: Alignment.center,
              padding: EdgeInsets.only(left: 55),
              decoration: new BoxDecoration(
                color: Colors.black12,
                // 设置四周圆角，角度
                borderRadius: BorderRadius.all(Radius.circular(50.0)),
              ),
              child: Row(
                children: [
                  Container(
                      margin: EdgeInsets.only(right: 8),
                      child: Image.asset(
                          'assets/images/common/cartoon/shuaxin.png')),
                  Text('换一批'),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
